﻿using J.Status.Application.Command.RoomTypeCommand;
using J.StatusModel.Dto;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.RoomTypeHandler
{
    public class RoomTypeDtoHandler : IRequestHandler<RoomTypeDtoCommand, List<RoomTypeDto>>
    {
        private readonly IRoomTypeService roomTypeService;

        public RoomTypeDtoHandler(IRoomTypeService roomTypeService)
        {
            this.roomTypeService = roomTypeService;
        }

        public async Task<List<RoomTypeDto>> Handle(RoomTypeDtoCommand request, CancellationToken cancellationToken)
        {
            return await roomTypeService.RoomTypeDto();
        }
    }
}
